package com.bakerj.infinitecards;

import ohos.agp.components.Component;

/**
 * CardItem
 *
 * @author BakerJ
 * @since : 2021.5.24
 */
public class CardItem {
    /**
     * Component view
     */
    public Component view;

    /**
     * zIndex z轴的距离
     */
    public float zIndex;
    int adapterIndex;

    /**
     * contrast
     *
     * @param view view
     * @param zIndex zIndex
     * @param adapterIndex adapterIndex
     */
    CardItem(Component view, float zIndex, int adapterIndex) {
        this.view = view;
        this.zIndex = zIndex;
        this.adapterIndex = adapterIndex;
    }

    @Override
    public int hashCode() {
        return view.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof CardItem && view.equals(((CardItem) obj).view);
    }
}
